<%@ page language="java" pageEncoding="UTF-8" isErrorPage="true" contentType="text/html; charset=utf-8" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">   
<title> 幼儿园管理系统</title>
<link rel="stylesheet" type="text/css" href="script/ext-2.0.2/resources/css/ext-all.css" />   
<script type="text/javascript" src="script/ext-2.0.2/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="script/ext-2.0.2/ext-all.js"></script>
<script type="text/javascript" src="script/ext-2.0.2/ext-lang-zh_CN.js"></script>
<script type="text/javascript">
	Ext.BLANK_IMAGE_URL = "script/ext-2.0.2/resources/images/default/s.gif";   
	Ext.onReady(function(){   
	    Ext.QuickTips.init();   
	    Ext.form.Field.prototype.msgTarget="qtip"; 
	    
	    //window
	    var logonWin = new Ext.Window({
	    	width:455,
	    	height:320,
	    	closable:false,
	    	floating:true,
	    	modal:true,
	    	shadow:'sides',
	    	shadowOffset:11,
	    	title:'幼儿园管理系统V1.0 - 系统登录',   
	    	items:[
				new Ext.form.FormPanel({   
				    renderTo:'container',   
				    labelSeparator:":",   
				    collapsible :true,   
				    width:440,   
				    height:290,   
				    id:'login',  
				    labelWidth: 100,
				    labelAlign: 'right',
				    bodyStyle: 'padding:5px 5px 0 10px;',  
				    border: false, 
				    name:'login',   
				    frame:true,   
				    defaults:{xtype:'textfield',border:false},   
				    items:[
					   	new Ext.Panel({
					   		//html:'<div class="ttl">房屋维修基金管理系统</div>',
					    	cls:'loginbg',	
					    	height:165,
					    	border:true
					    }),   
					    new Ext.Panel({height:12}),
					    {   
					        fieldLabel:"用户名",   
					        id:'un',
					        name:'userInfoVO.userCode',   
					        allowBlank:false,   
					        blankText:'用户名不能为空!',
					        cls:'username'
					    },{   
					        fieldLabel:"密&nbsp;&nbsp;&nbsp;码",   
					        name:'userInfoVO.password',   
					        id:'pwd',
					        allowBlank:false,   
					        inputType:'password',   
					        blankText:'密码不能为空!',
					        cls:'password'
					    }],   
					    keys:{   
					        key: 13,   
					        fn:login   
					    },   
					    buttons:[{   
					        text:'登 录', 
					        width:100,
					        handler:login   
					    },{   
					        text:'重 置',
					        width:100,
					        handler:function(){   
					            Ext.getCmp('un').reset();
					            Ext.getCmp('pwd').reset();
					        }   
				    }]
				}) 
	    	]
	    });
	    
	    logonWin.addListener('show',function(){Ext.getCmp('un').focus(false,100);});
	    logonWin.show();
	    
	    
	    function login(){   
	    	var oaForm = Ext.getCmp('login');
	  		if (oaForm.form.isValid()){
	  			oaForm.form.submit({
					url: 'login.action',
				  	waitTite:"系统登录中",
	               	waitMsg: '系统正在登录,请稍候......',
	               	success: function(){
						oaForm.form.reset();
						oaForm.hide();
						window.location.href='index.shtml';
					},
					failure:function(form,action){
						Ext.MessageBox.alert('提示信息', '系统登录失败,'+action.result.msg);
						//window.opener = null;
						//window.open('','_self');
						//window.close();
					}
	           });
	  		}
	    }   
	       
	});  
</script>   
</head>   
<body>   
<!-- div实现水平和垂直居中-->   
<div id="outer">   
    <div id="middle">   
        <div id="inner">   
	        <div id="container">   
	                       
	        </div>   
        </div>   
    </div> 
</div>
</body>   

</html>

